package com.zhao.controller;

import com.zhao.pojo.Product;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("product")
@RestController
public class ProductController {
    @GetMapping("getProduct/{id}")
    public Product getProduct(@PathVariable("id") String id) {
        Product product = new Product(id, "第" + id + "件超短裙");
        log.info("取得产品：{}", product);
        return product;
    }
}
